Skip to content

add moozy encoder#110

Merged
clemsgrs merged 3 commits intomainfrom
add-moozy
Apr 11, 2026
Merged

add moozy encoder#110
clemsgrs merged 3 commits intomainfrom
add-moozy

Conversation

@clemsgrs
Copy link
Copy Markdown
Owner

@clemsgrs clemsgrs commented Apr 11, 2026

Summary

Adds support for MOOZY, a slide- and patient-level foundation model built on the Lunit ViT-S/8 patch encoder.

  • lunit — new tile encoder (ViT-S/8 DINO, 384-dim, 0.5 µm)
  • moozy-slide — standalone slide encoder from the MOOZY stage-2 checkpoint (768-dim)
  • moozy — patient-level encoder: Lunit → MOOZY slide encoder → CaseAggregator transformer (768-dim)

New concepts

Patient-level encoders (PatientEncoder base class) aggregate slide embeddings across multiple slides per patient. They require a patient_id column in the input manifest CSV.

New Python API: Model.embed_patient(slides, patient_id=...) and Model.embed_patients(slides) return EmbeddedPatient with patient_embedding and per-slide slide_embeddings.

New config option: save_slide_embeddings: true saves intermediate per-slide MOOZY embeddings to slide_embeddings/ when running the patient pipeline. Patient embeddings are written to patient_embeddings/.

Files changed

  • encoders/base.pyPatientEncoder base class
  • encoders/registry.py — extended level validation to "patient"
  • encoders/models/lunit.py, moozy.py — new encoder registrations
  • artifacts.pyPatientEmbeddingArtifact, write_patient_embeddings()
  • api.pyEmbeddedPatient, Model.embed_patient/embed_patients, ExecutionOptions.save_slide_embeddings, RunResult.patient_artifacts
  • inference.pyembed_patients(), _run_patient_pipeline(), _encode_slide_from_tiles() helper
  • utils/tiling_io.pyload_patient_id_mapping()

@clemsgrs clemsgrs merged commit 27ce5a1 into main Apr 11, 2026
1 check passed
@clemsgrs clemsgrs deleted the add-moozy branch April 11, 2026 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant